const sleepPromise = time => new Promise((resolve) => {
  setTimeout(
    resolve,
    time
  )
})

async function sleepThenDo(time) {
  await sleepPromise(time)
  return
}

sleepThenDo(1000).then(() => console.log('awake'))
